<template>
	<view>
		<template v-if="userinfo&&userinfo.weak==2">
			<view class="rowbox wdh-100 weaknotice" v-if="noticeinfo.weak&&noticeinfo.weak!=''">
				<u-notice-bar :text="noticeinfo.weak"></u-notice-bar>
				<view class="rowbox def-bgcol notice-btn" @click="showVip">{{noticeinfo.name}}</view>
			</view>
			<kefubox ref="kefu"></kefubox>
		</template>
		<!-- vip弹窗 -->
		<vipBox ref="vipbuy"></vipBox>
	</view>
</template>

<script>
	import vipBox from '@/components/vipbuy.vue'
	import kefubox from '@/components/kefu.vue'
	export default {
		components: {
			kefubox,
			vipBox
		},
		data() {
			return {
				noticeinfo: null,
				userinfo: null
			};
		},
		mounted() {
			this.getNotice()
		},
		methods: {
			getUserInfo() {
				this.$req.post('/user/userInfo', {
					uid: uni.getStorageSync('uid')
				}).then(res => {
					if (res.data.data) {
						this.userinfo = res.data.data
					}
				})
			},
			getNotice() {
				// this.$req.post('/user/tixing').then(res => {
				// 	this.noticeinfo = res.data.data
				// })
			},
			showVip() {
				if (getApp().globalData.platform == 'ios') {
					this.$refs.kefu.show = true
				} else {
					this.$refs.vipbuy.show = true
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.weaknotice {
		position: fixed;
		bottom: 0;
		left: 0;
		background: #fdf5ea;
	}

	.notice-btn {
		color: #fff;
		font-size: 24rpx;
		margin: 0 20rpx;
		padding: 10rpx 20rpx;
		border-radius: 10rpx;
	}
</style>